<?php if (!defined('THINK_PATH')) exit();?><style>
    .daterangepicker.dropdown-menu, .select2-container--open {
        z-index: 99999999;
    }
    .select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
        height:30px;
    }
    .layui-layer-shade  {
        left:inherit;
        top:50px;
        position:absolute;
    }
</style>
<div class="row" id="myapp">
    <pop-user-capital-adjusted-component></pop-user-capital-adjusted-component>

    <div class="col-md-3">
        <!-- Profile Image -->
        <div class="box box-primary" style="display:block;">
            <div class="box-body box-profile">
                <img v-if="user.photo_url==''||user.photo_url==null" class="profile-user-img img-responsive img-circle" src="http://400tcc.cn/Public/images/null_photo.jpg">
                <img v-else class="profile-user-img img-responsive img-circle" v-bind:src="user.photo_url">

                <h3 class="profile-username text-center">{{user.nick_name}}</h3>

                <p class="text-muted text-center">
                    {{user.mobile_phone}}
                    <span v-if="user.state==0" style="cursor:pointer;margin-right:3px;" class="badge bg-green" @click="changeState(user.id, 1);">正常</span>
                    <span v-if="user.state==1" style="cursor:pointer;margin-right:3px;" class="badge bg-danger" @click="changeState(user.id, 0);">停用</span>
                    <span class="badge btn-danger" style="cursor:pointer;margin-right:3px;" @click="reset_pass(user.id);">重置密码</span>
                </p>
                <ul class="list-group list-group-unbordered">
                    <li class="list-group-item" v-if="user.recommend_name!=null">
                        <b>所属经纪人</b> <a class="pull-right">{{user.recommend_name}}</a>
                    </li>
                    <li class="list-group-item">
                        <b>资金余额(元)</b>
                        <a class="pull-right">
                            <span v-if="config[3] == 1" class="badge label-danger" style="cursor:pointer;margin-right:3px;" @click="capitalAdjusted(1)">加</span>
                            <span v-if="config[3] == 1" class="badge label-primary" style="cursor:pointer;margin-right:3px;" @click="capitalAdjusted(2)">扣</span>
                            {{user.balance}}
                        </a>
                    </li>
                    <li class="list-group-item" style="display:none;">
                        <b>代金卷(张)</b>
                        <a class="pull-right">
                            <span class="badge label-danger" style="cursor:pointer;margin-right:3px;" @click="give_voucher(user.id)">赠</span>
                            {{user.voucher_num}}
                        </a>
                    </li>
                    <li class="list-group-item">
                        <b>盈亏金额(元)</b> <a class="pull-right">{{user.total_gain_money}}</a>
                    </li>

                    <li class="list-group-item">
                        <b>会员类型</b> <a class="pull-right"><template v-if="user.agent_id>0">经纪人</template><template v-if="user.agent_id==0">普通会员</template></temp></a>
                    </li>
                    <li class="list-group-item" v-if="user.agent_id>0">
                        <b>经纪人未结算收益(元)</b>
                        <a class="pull-right"><span class="badge label-danger" style="cursor:pointer;margin-right:3px;display:none;" @click="capitalAdjusted(1, 1)">转</span>{{user.agent_balance}}</a>
                    </li>
                    <li class="list-group-item" v-if="user.agent_id>0">
                        <b>经纪人已结算收益(元)</b>
                        <a class="pull-right">{{user.settlement_money}}</a>
                    </li>

                </ul>
            </div>
        </div>
        <div class="box box-primary"  v-if="user.agent_id>0">
            <div class="box-body" style="padding:0px;">
                <img width="100%" style="margin-left:0px;border-radius:2%;" src="http://400tcc.cn/oauth2/user_wx_qrcode?user_id=<?php echo ($id); ?>" />
            </div>
        </div>
    </div>

    <!-- /.col -->
    <div class="col-md-9">
        <div class="nav-tabs-custom">
            <ul class="nav nav-tabs">
                <li @click="toggle(tab.view)" v-for="tab in user.tabs" v-bind:class="{'active':currentView===tab.view}"><a href="javascript:void(0)" data-toggle="tab">{{tab.name}}</a></li>
            </ul>
            <div class="tab-content">
                <component :is="currentView" user_id="<?php echo ($id); ?>"></component>
            </div>
            <!-- /.tab-content -->
        </div>
        <!-- /.nav-tabs-custom -->
    </div>
    <!-- /.col -->

</div>

<div class="layui-layer-shade" id="layui-layer-shade" times="1" style="z-index:19891014; background-color:#ffffff; opacity:1; filter:alpha(opacity=1);"></div>
<div class="layui-layer layui-layer-loading  layer-anim" id="layui_layer" type="loading" times="1" showtime="0" contype="string" style="z-index: 19891015;"><div id="" class="layui-layer-content layui-layer-loading0"></div><span class="layui-layer-setwin"></span></div>

<script>
    // var level_name = '<?php echo C("AGENTCONFIG")[0]['name'];?>';
    var root = 'admin';
    var id = <?php echo ($id); ?>;
    layuiLayerLoad();
</script>

<script src="./WebApp/Admin/View/Public/self/js/user/components.js"></script>
<script src="./WebApp/Admin/View/Public/self/js/user/info/tabs.js"></script>
<script src="./WebApp/Admin/View/Public/self/js/user/info/vue.js"></script>